package question4;

/**
 * 定义一个表示学生的类Student
 *
 * @FileName Student
 * @Description
 * @Author Sword
 * @date 2024-10-11
 **/
public class Student {
    //包括域 id name gender classId age
    private int id;
    private String name;
    private char gender;
    private int classId;
    private int age;

    public Student() {
    }

    public Student(int id, String name, char gender, int classId, int age) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.classId = classId;
        this.age = age;
    }

    //方法getId() getName() getAge()getGender() getClassId() setAge(int age)

    /**
     * 获取
     *
     * @return id
     */
    public int getId() {
        return id;
    }

    /**
     * 获取
     *
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 获取
     *
     * @return gender
     */
    public char getGender() {
        return gender;
    }

    /**
     * 获取
     *
     * @return classId
     */
    public int getClassId() {
        return classId;
    }


    /**
     * 获取
     *
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     *
     * @param age
     */
    public void setAge(int age) {
        this.age = age;
    }

    public String toString() {
        return "Student{id = " + id + ", name = " + name + ", gender = " + gender + ", classId = " + classId + ", age = " + age + "}";
    }
}
